import { Component, OnInit,Input } from '@angular/core';

@Component({
  selector: 'app-content',
  templateUrl: './content.component.html',
  styleUrls: ['./content.component.scss']
})
export class ContentComponent implements OnInit {
 @Input() title:string;
 msg:string ="hello world"
 handleClick(){
   this.msg="change"
 }
  constructor() { 
    console.log("constructor")
  }
  //有父子组件传参就触发  ，没有的话就不触发,ngOnInit优先触发
   ngOnChanges(){
    console.log("ngOnchanges")
   }
  ngOnInit() {
    console.log("ngOnInit")
  }
  ngDoCheck(){
    console.log("ngDoCheck")
  }
  //组件渲染完成之后触发
  ngAfterContentInit(){
    console.log("ngAfterContentInit")
  }
  //视图加载完成之后触发
  ngAfterViewInit(){
    console.log("ngAfterViewInit")
  }
  ngOnDestory(){
    console.log("")
  }
}
